package com.maixun.lib_comment

import com.maixun.lib_base.utils.SharedPrefUtil


/**
 * 作者：Lmoumou
 * 时间：2020/9/8 15:26
 *
 * 用户信息本地持久化管理
 */
object UserInfoManager {

    private const val NAME = "SharedPreferences_yszk"

    /*---------------------------------Token Start------------------------------------------------*/
    fun putToken(token: String) {
        SharedPrefUtil.open(NAME).putString("token", token)
    }

    fun getToken(): String = SharedPrefUtil.open(NAME).getString("token")

    fun removeToken() {
        SharedPrefUtil.open(NAME).remove("token")
    }
    /*---------------------------------Token End--------------------------------------------------*/

    /*---------------------------------Account Start----------------------------------------------*/
    fun putAccount(account: String) {
        SharedPrefUtil.open(NAME).putString("account", account)
    }

    fun getAccount(): String = SharedPrefUtil.open(NAME).getString("account")

    fun removeAccount() {
        SharedPrefUtil.open(NAME).remove("account")
    }
    /*---------------------------------Account End------------------------------------------------*/

    /*---------------------------------Password Start---------------------------------------------*/
    fun putPWSD(pwsd: String) {
        SharedPrefUtil.open(NAME).putString("pwsd", pwsd)
    }

    fun getPWSD(): String = SharedPrefUtil.open(NAME).getString("pwsd")

    fun remove() {
        SharedPrefUtil.open(NAME).remove("pwsd")
    }
    /*---------------------------------Password End-----------------------------------------------*/
}